package gold.digger;

import gold.utils.InputUtil;

import java.util.*;

/**
 * Created by fanzhenyu02 on 2020/6/22.
 */
public class LC448 {


    public List<Integer> findDisappearedNumbers(int[] arr) {
        int[] memo = new int[arr.length + 1];

        for (int i = 0; i < arr.length; i++) {
            memo[arr[i]] = -1;
        }

        List<Integer> res = new ArrayList<>();
        for (int i = 1; i <= arr.length; i++) {
            if (memo[i] != -1) {
                res.add(i);
            }
        }

        return res;
    }

    public static void main(String[] args) {
        LC448 an = new LC448();
        int[] arr = InputUtil.toIntegerArray("[4,3,2,7,8,2,3,1]");
        System.out.println(an.findDisappearedNumbers(arr));
    }
}
